import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'
import vm from './modules/vm'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    settings,
    user,
    vm
  },
  getters,
  plugins: [createPersistedState({
    key: 'likede', // 指定名称 默认vuex
    paths: ['user.token', 'user.userInfo', 'vm.tableData'] // 只可以指定缓存的模块 或者是模块里的字段
  })]
})

export default store
